package edu.maine.usm.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.RootLayoutPanel;

import edu.maine.usm.rpc.EnrollmentService;
import edu.maine.usm.rpc.EnrollmentServiceAsync;
import edu.maine.usm.rpc.OpenMRSClientService;
import edu.maine.usm.rpc.OpenMRSClientServiceAsync;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class MyDemo implements EntryPoint {

	EnrollmentServiceAsync service = GWT.create(EnrollmentService.class);
	OpenMRSClientServiceAsync openmrsService = GWT.create(OpenMRSClientService.class);
	
	public void onModuleLoad() {
		LayoutPanel lp = RootLayoutPanel.get();
		
		EnrollmentView ev = new EnrollmentView(service);
		lp.add(ev);
		lp.setWidgetTopHeight(ev, 0, Unit.PCT, 50, Unit.PCT);
		lp.setWidgetLeftRight(ev, 0, Unit.PCT, 50, Unit.PCT);

		EnrollmentListView elv = new EnrollmentListView(service);
		lp.add(elv);
		lp.setWidgetTopHeight(elv, 0, Unit.PCT, 50, Unit.PCT);
		lp.setWidgetLeftRight(elv, 50, Unit.PCT, 0, Unit.PCT);

		AlertEventView aev = new AlertEventView(service, openmrsService);
		lp.add(aev);
		lp.setWidgetTopHeight(aev, 50, Unit.PCT, 50, Unit.PCT);
		lp.setWidgetLeftRight(aev, 0, Unit.PCT, 50, Unit.PCT);

	}
}
